<template>
  <div>
    <el-row :gutter="10">
      <el-col :span="6" class="title">CPD后台管理系统</el-col>
      <el-col :span="18">
        <div class="toolbar">
          <el-dropdown>
            <el-icon style="margin-right: 10px; margin-top: 1px" size="20" color="white">
              <setting/>
            </el-icon>
            <template #dropdown>
              <el-dropdown-menu>
                <el-dropdown-item @click="toLogin">退出登录</el-dropdown-item>
              </el-dropdown-menu>
            </template>
          </el-dropdown>
          <span style="font-size: 20px">admin</span>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script setup>
import {Setting} from "@element-plus/icons-vue";
import {useRouter} from "vue-router";
const router = useRouter()

function toLogin(){
  router.replace({path:"/login"})
}
</script>

<style>
.toolbar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  right: 20px;
}
.title {
  text-shadow: 1px 1px 3px gray;
}
.el-row {
  width: 100%;
  height: 100%;
}
.el-col {
  height: 100%;
  font-size: 18px;
}
.el-col:nth-child(2) {
  text-align: right;
  line-height: 60px;
  font-size: 14px;
}
.el-col:nth-child(3) {
  text-align: right;
  line-height: 60px;
}
</style>